// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   homePage_ok.java

package ecommerce.website.template;

import include.nseer_db.nseer_db_backup1;
import include.query.getRecordCount;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class homePage_ok extends HttpServlet
{

	ServletContext application;
	HttpSession session;
	nseer_db_backup1 erp_db;

	public homePage_ok()
	{
		erp_db = null;
	}

	public synchronized void doPost(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		ServletContext dbApplication = dbSession.getServletContext();
		try
		{
			java.io.PrintWriter out = response.getWriter();
			nseer_db_backup1 ecommerce_db = new nseer_db_backup1(dbApplication);
			if (ecommerce_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				getRecordCount query = new getRecordCount();
				String unit_id = request.getParameter("unit_id");
				String cols = request.getParameter("col");
				if (cols == null)
				{
					response.sendRedirect("ecommerce/website/template/homePage_ok_a.jsp");
				} else
				{
					String sql = (new StringBuilder("update ecommerce_web_base set home_page='")).append(cols).append("' where unit_id='").append(unit_id).append("'").toString();
					ecommerce_db.executeUpdate(sql);
					response.sendRedirect("ecommerce/website/template/homePage_ok_b.jsp");
				}
				ecommerce_db.commit();
				ecommerce_db.close();
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
